<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('WIP生产看板')" />
    <style>
        .bg-blue {
            background-color: #0074D9 !important;
        }

        .bg-green {
            background-color: green !important;
        }

        .bg-red {
            background-color: red !important;
        }
    </style>
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>批次号：</label>
                                <input type="text" name="batchNo"/>
                            </li>
                            <li>
                                <label>订单号：</label>
                                <input type="text" name="orderNo"/>
                            </li>
                            <li>
                                <label>销售员ID：</label>
                                <input type="text" name="salesmanNo"/>
                            </li>
                            <li>
                                <label>生产型号：</label>
                                <input type="text" name="modelNo"/>
                            </li>
                            <li>
                                <label>客户编号：</label>
                                <input type="text" name="customerNo"/>
                            </li>
                            <li>
                                <label>批次状态：</label>
                                <select name="state" th:with="type=${@dict.getType('erp_batch_state')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>生产级别：</label>
                                <select name="batchPriority" th:with="type=${@dict.getType('erp_process_level')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:erpBatchInfo:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('erp:erpBatchInfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('erp:erpBatchInfo:remove')}]];
        var stateDatas = [[${@dict.getType('erp_batch_state')}]];
        var levelDatas = [[${@dict.getType('erp_process_level')}]];
        var processStateDatas = [[${@dict.getType('erp_process_state')}]];
        var prefix = ctx + "erp/erpBatchInfo";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                pageSize:100,
                modalName: "生产批次",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键ID',
                    visible: false
                },
                {
                    field: 'batchNo',
                    title: '批次号'
                },
                {
                    field: 'orderNo',
                    title: '订单号'
                },
                {
                    field: 'salesmanNo',
                    title: '销售员ID'
                },
                {
                    field: 'modelNo',
                    title: '生产型号'
                },
                {
                    field: 'customerNo',
                    title: '客户编号'
                },
                {
                    field: 'state',
                    title: '批次状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(stateDatas, value);
                    }
                },
                {
                    field: 'batchPriority',
                    title: '生产优先级',
                    rowStyle: function (row, index) {
                        var classes = [
                            'bg-blue',
                            'bg-blue',
                            'bg-blue'
                        ]
                        return {
                            css: {
                                color: classes[index / 2]
                            }
                        }
                    },
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(levelDatas, value);
                    }
                },
                {
                    field: 'length',
                    title: '长'
                },
                {
                    field: 'wide',
                    title: '宽'
                },
                {
                    field: 'pnlLength',
                    title: 'PNL长'
                },
                {
                    field: 'pnlWide',
                    title: 'PNL宽'
                },
                {
                    field: 'pcsNum',
                    title: 'PCS数'
                },
                {
                    field: 'continuousNum',
                    title: '连片数量'
                },
                {
                    field: 'deliveryNum',
                    title: '连片数量'
                },
                {
                    field: 'feedNum',
                    title: '投料数量'
                },
                {
                    field: 'cuttingTime',
                    title: '开料日期'
                },
                {
                    field: 'processState',
                    title: '当前工序',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(processStateDatas, value);
                    }
                },
                {
                    field: 'pnlTotalNum',
                    title: 'PNL总数'
                },
                {
                    field: 'qlNum',
                    title: '欠料'
                },
                {
                    field: 'klNum',
                    title: '开料'
                },
                {
                    field: 'yhNum',
                    title: '压合'
                },
                {
                    field: 'zkNum',
                    title: '钻孔'
                },
                {
                    field: 'ddjNum',
                    title: '导电胶'
                },
                {
                    field: 'xlNum',
                    title: '线路'
                },
                {
                    field: 'xjNum',
                    title: '线检'
                },
                {
                    field: 'tdNum',
                    title: '图电'
                },
                {
                    field: 'sjNum',
                    title: '蚀检'
                },
                {
                    field: 'zcNum',
                    title: '中测'
                },
                {
                    field: 'zhNum',
                    title: '阻焊'
                },
                {
                    field: 'zjNum',
                    title: '阻检'
                },
                {
                    field: 'zfwzNum',
                    title: '字符文字'
                },
                {
                    field: 'bmclNum',
                    title: '表面'
                },
                {
                    field: 'ezNum',
                    title: '二钻'
                },
                {
                    field: 'dbfzNum',
                    title: '大板飞针'
                },
                {
                    field: 'cxwxNum',
                    title: '成型外形'
                },
                {
                    field: 'testNum',
                    title: '测试'
                },
                {
                    field: 'fqcNum',
                    title: 'FQC'
                },
                {
                    field: 'rkTotal',
                    title: '累计入库'
                },
                {
                    field: 'orderArea',
                    title: '订单面积'
                },
                {
                    field: 'prdArea',
                    title: '生产面积'
                },
                {
                    field: 'linePnl',
                    title: '在线PNL'
                },
                {
                    field: 'lineArea',
                    title: '在线面积'
                },
                {
                    field: 'remark',
                    title: '备注'
                }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>